package com.shop.listener;

import javax.servlet.ServletRequestAttributeEvent;
import javax.servlet.ServletRequestAttributeListener;
import javax.servlet.annotation.WebListener;
//监听属性的变化
//@WebListener
public class MyRequestAttributeListener  implements ServletRequestAttributeListener{

	@Override
	public void attributeAdded(ServletRequestAttributeEvent srae) {
		String name = srae.getName();
		Object value = srae.getValue();
		System.out.println("==添加属性==" +name+"-->"+value);
	}
	
	@Override
	public void attributeReplaced(ServletRequestAttributeEvent srae) {
		String name = srae.getName();
		Object value = srae.getValue();
		System.out.println("==替换属性=="+name+"-->"+value);
	
	}
	@Override
	public void attributeRemoved(ServletRequestAttributeEvent srae) {
		String name = srae.getName();
		System.out.println("==移除属性=="+name);
	}
}
